import Community from "../views/community";
import Explore from "../views/explore";
import InBox from "../views/inBox";
import Register from '../views/register';
import Login from "../views/login";
import User from "../views/user";
import Wish from "../views/wishList";
import Wishchild from '../views/wishChild'
import {lazy } from 'react'

const Pay = lazy(( ) => import('../views/pay'))
const Search = lazy(( ) => import('../views/search'))
const SearchResults = lazy(( ) => import('../views/searchresults'))
const Details = lazy(( ) => import('../views/details'))

// const Wishchild = lazy(() => import('../views/wishChild'))
interface IRoutes {
  path:string;
  element:JSX.Element;
  title?:string;
  icon?:JSX.Element|string;
}

export const routes: IRoutes[]= [
  {
    path:'/',
    element:<Explore/>,
    icon:'',
    title:'探索'
  },
  {
    path:'/community',
    element:<Community/>,
    icon:'',
    title:'社区'
  },
  {
    path:'/inbox',
    element:<InBox/>,
    icon:'',
    title:'收件箱'
  },
  {
    path:'/login',
    element:<Login/>,
    icon:'',
    title:'登录'
  },
  {
    path:'/register',
    element:<Register/>,
    icon:'',
    title:'注册'
  },
  {
    path:'/user',
    element:<User/>,
    icon:'',
    title:'用户'
  },
  {
    path:'/wish',
    element:<Wish/>,
    icon:'',
    title:'心愿单'
  },
  {
    path:'/wishChild',
    element:<Wishchild/>,
    icon:'',
    title:'心愿'
  },
  {
    path:'/pay',
    element:<Pay/>,
    icon:'',
    title:'支付'
  },
  {
    path:'/search',
    element:<Search/>,
    icon:'',
    title:'搜索'
  },
  {
    path:'/searchresults',
    element:<SearchResults/>,
    icon:'',
    title:'搜索结果'
  },
  {
    path:'/details',
    element:<Details/>,
    icon:'',
    title:'搜索结果'
  }
]